// pages/vedio/vedioDetail.js
const app = getApp();
Page({
  data: {
    detailList: {}
  },

  onLoad: function (options) {
    // 获取对象字符串
    let objStr = options.JsonStr;
    // console.log(objStr);

    this.getDetail(options.JsonStr);
  },
  // 获取数据
  getDetail(obj) {
    // 转成对象
    let detailList = JSON.parse(obj);
    
    detailList.premiereAt = this.formatDate(detailList);
    // 设置
    this.setData({detailList});
  },
      // 格式化时间
  formatDate(obj) {
    let date = new Date(obj.premiereAt);
    let y = date.getFullYear();
    let m = date.getMonth() + 1;
    let d = date.getDate();
    return `${y}-${m}-${d}`;
  }
})